package com.zhiling.www.controller;

import com.zhiling.www.entity.EntrustOrder;
import com.zhiling.www.entity.Result;
import com.zhiling.www.service.StockService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/stock")
public class StockController {

    private Logger logger = Logger.getLogger(StockController.class);
    @Autowired
    private StockService stockService;

    //分页查询所有股票信息
    @RequestMapping("/list")
    public Result loadStockList(int page,int pageSize){
        return stockService.findStockList(page,pageSize);
    }

    //查询单个股票信息
    @GetMapping("/searchstock")
    public Result searchStock(String codeOrName){
        return stockService.searchStock(codeOrName);
    }


}
